using NFreeMarker.Core;
using NUnit.Framework;

// ReSharper disable InconsistentNaming
namespace NFreeMarker.Tests.Template
{
    public class TemplateTests_ProcessBuiltIns
    {
        [TestFixture]
        public class When_processing_a_non_existing_builtin : TemplateTestsBase
        {
            [Test]
            public void Assure_a_ParseException_is_thrown()
            {
                SetTemplateContent("${message?foo}");
                AddTemplateVariable("message", "Hello world");

                Assert.That(
                    () => ProcessTemplate(),
                    Throws.Exception.TypeOf<ParseException>().
                    With.Message.ContainsSubstring("Found foo, expecting one of:"));
            }
        }
    }
}
// ReSharper enable InconsistentNaming
